<template>
  <div :class="['drawer_panel', flag ? 'open' : 'close']">
    <!-- <toggle class="position_btn" @click.native="toggle_handler()" :flagState="flag"> </toggle> -->
    <toggle class="position_btn" @click.native="toggle_handler()"> </toggle>
    <slot name="detail"></slot>
  </div>
</template>

<script>
  import toggle from "./toggle.vue";
  import {
    mapMutations,
    mapState
  } from "vuex";
  export default {
    name: "right-panel",
    components: {
      toggle
    },
    props: {

    },
    data() {
      return {

      }
    },
    methods: {
      ...mapMutations({
        change_drawerFlag: "ontologyModel/change_drawerFlag"
      }),
      toggle_handler() {
        this.change_drawerFlag();
      },
    },
    computed: {
      ...mapState({
        flag: state => state.ontologyModel.drawerFlag,
      }),
    },
  }
</script>

<style lang="scss" scoped>
  .drawer_panel {
    width: 424px;
    height: 100%;
    position: absolute;
    z-index: 1;
    margin-right: 0;
    top: 0;
    right: 0;
    box-shadow: -3px 3px 7px rgba(80, 102, 155, 0.28);
    // transition: margin-right 0.7s ease 0s;

    &.open {
      margin-right: -450px;
    }
    &.close {
      right: -24px;
    }

    .position_btn {
      position: absolute;
      top: 0;
      bottom: 0;
      left: -16px;
      margin: auto;
    }

    .el-tabs {
      width: 424px;
      height: 100%;
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      text-align: center;
    }

    .el-tabs--border-card {
      border: none;
    }

    /deep/ .el-tabs__header {
      border-bottom: none;
    }

    /deep/ .el-tabs--border-card>.el-tabs__content {
      padding: 16px;
    }
  }

  /deep/ .el-tabs__nav {
    height: 48px;
    width: 100%;
    display: flex;
    justify-content: space-between;
  }

  /deep/ .el-tabs__item {
    width: 106px;
    height: 48px;
    line-height: 48px;
    font-size: 16px;
    flex-grow: 1;
    background-color: #F3F4F8;
    color: #A1A6B5;
  }

  /deep/ .el-tabs__content {
    box-sizing: border-box;
    width: 100%;
    padding-bottom: 0;
    flex-grow: 1;

    .el-tab-pane {
      height: 100%;
    }
  }

  /deep/ .el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active {
    background-color: #FFFFFF;
    color: #3A58B9;
    border: none;
    border-color: aliceblue;
    border-top: 2px solid #2D4697;
  }

  /deep/ .el-tabs--border-card>.el-tabs__header .el-tabs__item:not(.is-disabled):hover {
    color: #3A58B9;
  }
</style>